﻿using System;
using System.Net;
using System.ComponentModel;
using System.Collections.Generic;

/// <summary>
/// Summary description for MikeKappel
/// </summary>
namespace csToolkit.Data.BindingLists
{
    /// <summary>
    /// Status Code Binding List
    /// </summary>
    [Serializable]
    public class StatusCodeBindingList : BindingList<StatusCode>
    {
        public StatusCodeBindingList()
        {
            foreach (HttpStatusCode StatusCode in Enum.GetValues(typeof(HttpStatusCode)))
            {
                this.Add(new StatusCode(((Int32)(StatusCode)).ToString(),
                "(" + ((Int32)(StatusCode)).ToString() + ") " + StatusCode.ToString()));
            }
        }
    }

    /// <summary>
    /// Status Code Items
    /// </summary>
    [Serializable]
    public class StatusCode
    {
        private String code;
        private String description;

        public StatusCode(String HttpStatusCode, String HttpStatusDescription)
        {
            code = HttpStatusCode;
            description = HttpStatusDescription;
        }

        public String Code
        {
            get { return code; }
            set { code = value; }
        }
        public String Description
        {
            get { return description; }
            set { description = value; }
        }
        public override string ToString()
        {
            return description;
        }
    }
}
